/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MainPanelView.java
 *
 * Created on 18.10.2011, 20:54:08
 */

package de.hdm.itproject.views;

import de.hdm.itproject.App;
import javax.swing.JFrame;

/**
 *
 * @author tim
 */
public class MainPanelView extends javax.swing.JPanel {

    /** Creates new form MainPanelView */
    public MainPanelView() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        MainPanel = new javax.swing.JPanel();
        btxViewCreatePlane = new javax.swing.JButton();
        btnMainPanelManageData = new javax.swing.JButton();
        btnViewManagePlanes = new javax.swing.JButton();

        setName("Form"); // NOI18N
        setLayout(new java.awt.BorderLayout());

        MainPanel.setName("MainPanel"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(de.hdm.itproject.App.class).getContext().getResourceMap(MainPanelView.class);
        btxViewCreatePlane.setText(resourceMap.getString("btxViewCreatePlane.text")); // NOI18N
        btxViewCreatePlane.setName("btxViewCreatePlane"); // NOI18N
        btxViewCreatePlane.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btxViewCreatePlaneMouseClicked(evt);
            }
        });

        btnMainPanelManageData.setText(resourceMap.getString("btnMainPanelManageData.text")); // NOI18N
        btnMainPanelManageData.setName("btnMainPanelManageData"); // NOI18N
        btnMainPanelManageData.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnMainPanelManageDataActionPerformed(evt);
            }
        });

        btnViewManagePlanes.setText(resourceMap.getString("btnViewManagePlanes.text")); // NOI18N
        btnViewManagePlanes.setName("btnViewManagePlanes"); // NOI18N
        btnViewManagePlanes.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnViewManagePlanesMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout MainPanelLayout = new javax.swing.GroupLayout(MainPanel);
        MainPanel.setLayout(MainPanelLayout);
        MainPanelLayout.setHorizontalGroup(
            MainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, MainPanelLayout.createSequentialGroup()
                .addGap(137, 137, 137)
                .addGroup(MainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(btnMainPanelManageData)
                    .addComponent(btxViewCreatePlane)
                    .addComponent(btnViewManagePlanes, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(122, Short.MAX_VALUE))
        );

        MainPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {btnMainPanelManageData, btnViewManagePlanes, btxViewCreatePlane});

        MainPanelLayout.setVerticalGroup(
            MainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(MainPanelLayout.createSequentialGroup()
                .addGap(68, 68, 68)
                .addComponent(btnViewManagePlanes)
                .addGap(39, 39, 39)
                .addComponent(btxViewCreatePlane)
                .addGap(44, 44, 44)
                .addComponent(btnMainPanelManageData)
                .addGap(135, 135, 135))
        );

        MainPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {btnMainPanelManageData, btnViewManagePlanes, btxViewCreatePlane});

        add(MainPanel, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents

    private void btnViewManagePlanesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnViewManagePlanesMouseClicked
        // TODO add your handling code here:
        JFrame mainFrame = App.getApplication().getMainFrame();
        mainFrame.setContentPane(new ManagePlanesView());
        mainFrame.validate();
        mainFrame.repaint();

}//GEN-LAST:event_btnViewManagePlanesMouseClicked

    private void btxViewCreatePlaneMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btxViewCreatePlaneMouseClicked
        // TODO add your handling code here:
        JFrame mainFrame = App.getApplication().getMainFrame();
        mainFrame.setContentPane(new CreatePlaneViewnew());
        mainFrame.validate();
        mainFrame.repaint();

    }//GEN-LAST:event_btxViewCreatePlaneMouseClicked

    private void btnMainPanelManageDataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMainPanelManageDataActionPerformed
        // TODO add your handling code here:
        JFrame mainFrame = App.getApplication().getMainFrame();
        mainFrame.setContentPane(new MainPanelTabbed());
        mainFrame.validate();
        mainFrame.repaint();
    }//GEN-LAST:event_btnMainPanelManageDataActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel MainPanel;
    private javax.swing.JButton btnMainPanelManageData;
    private javax.swing.JButton btnViewManagePlanes;
    private javax.swing.JButton btxViewCreatePlane;
    // End of variables declaration//GEN-END:variables

}
